prepare("select * from items where item_id = $id") ; $getd->execute() ; $row = $getd->fetch(pdo::FETCH_ASSOC) ; $unames = $row['item_name'] ; $roomcat = $row['item_category'] ; $cprice = $row['cprice'] ; $bprice = $row['bar_price'] ; $vprice = $row['vlprice'] ; $barcode = $row['barcode'] ; if(isset($_POST['submit'])) { $names = trim($_POST['names']) ; $cat = trim($_POST['cat']) ; $ccprice = trim($_POST['cprice']) ; $bbprice = trim($_POST['bprice']) ; $vvprice = trim($_POST['vprice']) ; $bc = trim($_POST['bar']) ; $upd = $DBcon->prepare("update items set item_category =:a, item_name = :c, cprice =:cp, bar_price =:bp,vlprice =:vp, barcode =:b where item_id = $id") ; $upd->bindparam(":a",$cat) ; $upd->bindparam(":cp",$ccprice) ; $upd->bindparam(":bp",$bbprice) ; $upd->bindparam(":vp",$vvprice) ; $upd->bindparam(":b",$bc) ; $upd->bindparam(":c",$names) ; if($upd->execute()) header("location: items.php") ; } ?> Update Items

Edit Item Category